package com.csdj.controller.sy;

import com.csdj.common.utils.ResponseResult;
import com.csdj.service.SyMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 涵哥
 * @date 2023-08-26 12:53
 */
@RestController
@RequestMapping("/sy/menu")
public class SystemMenuController {

    @Autowired
    private SyMenuService syMenuService;

    /**
     * 拿到全部数据
     * @return
     */
    @GetMapping
    public ResponseResult list(){
        return syMenuService.getAll();
    }

    /**
     * 根据员工id返回该员工有的权限
     * @param id
     * @return
     */
    @GetMapping("/byEmpId/{id}")
    public ResponseResult queryByEmpId(@PathVariable("id") Integer id) {
        return  syMenuService.getEmpMenuList(id);
    }
}
